#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

// 大数乘法函数
string multiply(string num, int k) {
    string result = "";
    int carry = 0;
    
    // 从右到左逐位相乘
    for (int i = num.length() - 1; i >= 0; i--) {
        int digit = (num[i] - '0') * k + carry;
        result = char(digit % 10 + '0') + result;
        carry = digit / 10;
    }
    
    // 处理最高位的进位
    while (carry > 0) {
        result = char(carry % 10 + '0') + result;
        carry /= 10;
    }
    
    return result;
}

// 检查两个字符串是否为循环排列
bool isCircularPermutation(string s1, string s2) {
    if (s1.length() != s2.length()) {
        return false;
    }
    
    // 将s1重复一次，然后检查s2是否为其子串
    string doubled = s1 + s1;
    return doubled.find(s2) != string::npos;
}

int main() {
    string num;
    cin >> num;
    
    int n = num.length();
    bool isCyclic = true;
    
    // 检查乘以1到n的结果
    for (int k = 1; k <= n; k++) {
        string product = multiply(num, k);
        
        // 如果乘积位数不等于原数位数，或者不是循环排列，则不是循环数
        if (product.length() != n || !isCircularPermutation(num, product)) {
            isCyclic = false;
            break;
        }
    }
    
    if (isCyclic) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    
    return 0;
}